//
//  ScenicDetailIntroduce.m
//  ImGuider
//
//  Created by 王鹏宇 on 2018/1/30.
//  Copyright © 2018年 imguider. All rights reserved.
//

#import "ScenicDetailIntroduce.h"
#import "TabItem.h"
@interface ScenicDetailIntroduce()
// 景点名称
@property (weak, nonatomic) IBOutlet UIView *nameView;
@property (weak, nonatomic) IBOutlet UILabel *nameDescribeLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *nameViewHeight;

@property (nonatomic, strong)TabItem * mapBtn;

//// 电话
//@property (weak, nonatomic) IBOutlet UIView *phoneView;
//@property (weak, nonatomic) IBOutlet UILabel *phoneDescribeLabel;
//@property (weak, nonatomic) IBOutlet UIButton *phoneBtn;
//@property (weak, nonatomic) IBOutlet NSLayoutConstraint *phoneHeight;
//
//// 网站
//@property (weak, nonatomic) IBOutlet UIView *websiteView;
//@property (weak, nonatomic) IBOutlet UILabel *websiteDescribeLabel;
//@property (weak, nonatomic) IBOutlet UIButton *websiteBtn;
//@property (weak, nonatomic) IBOutlet NSLayoutConstraint *websiteHeight;
//
//// 用时参考
//@property (weak, nonatomic) IBOutlet UIView *elapsedView;
//@property (weak, nonatomic) IBOutlet UILabel *elapsedDescribeLabel;
//@property (weak, nonatomic) IBOutlet UIButton *elapsedBtn;
//@property (weak, nonatomic) IBOutlet NSLayoutConstraint *elapsedHeight;

@end


@implementation ScenicDetailIntroduce

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    
//    self.elapsedHeight.constant = 0;
//    self.elapsedView.hidden = YES;
//
//    self.phoneDescribeLabel.text = MYLocalizedString(@"SITELIST_PHONE", nil);
//    self.websiteDescribeLabel.text = MYLocalizedString(@"SITELIST_WEBSITE", nil);
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.mapBtn = [TabItem  initTabItemWith:@{@"imageName":@"lines_gps",@"title":@""}];
    self.mapBtn.Ratio = 0.9;
    self.mapBtn.frame = CGRectMake(0, 0, 36, 40);
    [self.contentView addSubview:self.mapBtn];
    [self.mapBtn addTarget:self action:@selector(tapAction) forControlEvents:UIControlEventTouchUpInside];
    [self.mapBtn setTitleColor:kContentColor forState:UIControlStateNormal];
    self.mapBtn.titleLabel.font = Font(12);
    [self.mapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.equalTo(self.contentView.mas_trailing).offset(-16);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.width.mas_equalTo(36);
        make.height.mas_equalTo(40);
    }];
}

-(void)tapAction {
    
    if (_delegate && [_delegate respondsToSelector:@selector(goAction:)]) {
        [_delegate goAction:3];
    }
}

//- (IBAction)tapAction:(UIButton *)sender {
//
//    if (_delegate && [_delegate respondsToSelector:@selector(goAction:)]) {
//        [_delegate goAction:sender.tag];
//    }
//}

- (void)setDataWith:(NSString *)title Address:(NSString *)address {
    
    self.nameLabel.textColor = kThemeColor;
    self.nameLabel.font = Font(14);
    self.nameLabel.text = address;
    self.nameDescribeLabel.textColor = kSubitleColor;
    self.nameDescribeLabel.font = FontBold(14);
    self.nameDescribeLabel.text = title;
}
- (void)configData:(Scenic *)scenic {
    
    self.nameLabel.text = scenic.ename;
    self.nameDescribeLabel.text = scenic.viewname;
    self.nameLabel.font = FontBold(14);
    self.nameDescribeLabel.font = FontBold(14);

    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
